package com.one.blocks.rbac.config;

import com.alicp.jetcache.anno.config.CommonConfiguration;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

/**
 * jetcache不支持EnableMethodCache多个注解扫描，所以这里要额外扫描rbac包 @see https://github.com/alibaba/jetcache/issues/249
 *
 * @author <a href="mailto:idler41@163.com">linfuxin</a> created by 2022-02-19 19:37:30
 */
@Configuration
@EnableMethodCache(basePackages = {"com.one.blocks.rbac.manager", "com.one.blocks.rbac.security"}, order = Ordered.HIGHEST_PRECEDENCE + 1)
@EnableCreateCacheAnnotation
@ConditionalOnMissingBean(CommonConfiguration.class)
public class RbacCacheConfig {
}
